package com.ruoyi.common.enums;

import com.ruoyi.common.utils.StringUtils;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum SourceType {

    /**
     * 前台
     */
    WEB("0"),

    /**
     * 后台
     */
    MGR("1");

    private final String sourceType;

    public static SourceType getUserType(String str) {
        for (SourceType value : values()) {
            if (StringUtils.contains(str, value.getSourceType())) {
                return value;
            }
        }
        throw new RuntimeException("'sourceType' not found By " + str);
    }
}
